﻿<!DOCTYPE html>
<html>
<head>
    <title>数据管理</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">


    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css?v=1">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_533449_naak7odp5x.css" />

    <style>
        .el-button-group button {
            border-radius: 0px;
        }

        .widthmax {
            width: 100%
        }

        .pd40 {
            padding: 40px;
        }

        .pd0 {
            padding: 0;
        }
    </style>
</head>
<body class="BG">
    <div id="DATABI_DSETZZ" class="FormV">
        <el-container>
            <el-main class="elmain pd40">
                <el-form ref="form" :model="form" label-width="180px">

                    <el-form-item label="是否开启上报功能">
                        <el-switch v-model="form.iskq"
                                   active-value="Y"
                                   inactive-value="N"
                                   active-text="开启"
                                   inactive-text="关闭">
                        </el-switch>
                    </el-form-item>
                    <el-form-item label="">
                        粮油作物亩均用水量指标 上限
                        <el-input-number v-model="form.lydesx" size="mini" controls-position="right" :min="1" :max="4" :precision="1" :step="0.1"></el-input-number>
                        倍 灌水定额，下线
                        <el-input-number v-model="form.lydexx" size="mini" controls-position="right" :min="0" :max="1" :precision="1" :step="0.1"></el-input-number>

                        倍灌水定额
                    </el-form-item>
                  
                    <el-form-item label="">
                        经济作物亩均用水量指标 上限
                        <el-input-number v-model="form.jjdesx" size="mini"  controls-position="right" :min="1" :max="4" :precision="1" :step="0.1"> </el-input-number>
                        倍 灌水定额，下线
                        <el-input-number v-model="form.jjdexx" size="mini"  controls-position="right" :min="0" :max="1" :precision="1" :step="0.1"></el-input-number>
                        倍灌水定额
                    </el-form-item>
                  
                    <el-form-item label="水价说明">
                        <div style="max-height:450px;overflow:auto">


                            <el-input type="textarea" id="sjsm" class="szhl_UEEDIT" v-model="form.sjsm"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="onSubmit" v-if="isbc">立即保存</el-button>
                        <el-button type="primary" @click="hqyh">huoquyinh</el-button>

                    </el-form-item>

                </el-form>
            </el-main>
        </el-container>

    </div>
    <script src="/ViewV5/JS/vue.js"></script>
    <script type="text/javascript" src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <script src="/ViewV5/JS/lodash.min.js"></script>
    <script src="/ViewV5/JS/httpVueLoader.js"></script>
    <script src="/ViewV5/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>

    <script type="text/javascript" charset="utf-8" src="/ToolS/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ToolS/ueditor/ueditor.all.min.js"></script>
    <script src="/ViewV5/JS/bijs.js?v=4"></script>
    <script>
        var app = new Vue({
            el: '#DATABI_DSETZZ',
            data: {
                isbc: false,
                form: {
                    glz: "",
                    sjsm: "",
                    iskq: "Y",
                    jjdesx: "1.1",
                    jjdexx: "0.8",
                    lydesx: "1.1",
                    lydexx: "0.8",
                }

            },

            methods: {
                initedit: function () {
                    var pro = this;
                    var um = UE.getEditor("sjsm");
                    um.ready(function () {

                        if (pro.form.sjsm != "") {
                            //需要ready后执行，否则可能报错
                            um.setContent(pro.form.sjsm);
                        }

                    })
                    //um.addListener('contentChange', function () {
                    //    pro.pzoption.value = um.getContent();
                    //})
                    um.addListener('blur', function () {
                        pro.form.sjsm = um.getContent();
                    })

                },
                hqyh: function () {
                    $.getJSON('/api/Bll/ExeAction?Action=SFJS_JKDZJK', {}, function (resultData) {
                        alert(resultData.Result)

                    })
                },
                onSubmit: function () {
                    $.getJSON('/api/Bll/ExeAction?Action=SFJS_SETSJSMBC', { P1: app.form.sjsm, P2: "1", pz: JSON.stringify(app.form), iskq: app.form.iskq }, function (resultData) {
                        alert('操作成功!')
                    })
                }
            },
            mounted: function () {

                var pro = this;
                if (top.model.$root.pagedata.ActionData == "立即保存") {
                    pro.isbc = true;
                }
                pro.$nextTick(function () {
                    $.getJSON('/api/Bll/ExeAction?Action=SFJS_SETSJSM', { P1: "", P2: "0" }, function (resultData) {
                        app.initedit();
                        if (resultData.Result.EncodingAESKey) {
                            app.form = JSON.parse(resultData.Result.EncodingAESKey);

                        }
                        app.form.sjsm = resultData.Result.wxqrcode;

                    })
                })
            },
            created() {
            },
            watch: {
                'form.sjsm': { //深度监听，可监听到对象、数组的变化
                    handler(newV, oldV) {
                        if (newV) {
                            var pro = this;
                            var um = UE.getEditor("sjsm");
                            um.setContent(newV);
                        }
                    },
                    deep: true
                },
            }

        })


    </script>

</body>

</html>